﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace sy2_4
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void label1_Click(object sender, EventArgs e)
        {

        }

        private void button1_Click(object sender, EventArgs e)
        {
            // 转换输入为整数
            int n1 = int.Parse(textBox1.Text);
            int n2 = int.Parse(textBox2.Text);
            int n3 = int.Parse(textBox3.Text);
            int temp; // 临时变量，用于交换数值

            // 第一步：确保n1≥n2
            if (n1 < n2)
            {
                temp = n1;
                n1 = n2;
                n2 = temp;
            }
            // 第二步：确保n1≥n3（此时n1是最大值）
            if (n1 < n3)
            {
                temp = n1;
                n1 = n3;
                n3 = temp;
            }
            // 第三步：确保n2≥n3（此时n2是次大值，n3是最小值）
            if (n2 < n3)
            {
                temp = n2;
                n2 = n3;
                n3 = temp;
            }
            // 显示结果
            textBox4.Text = $"{n1}>{n2}>{n3}";
        }

        private void button2_Click(object sender, EventArgs e)
        {
            int n1 = int.Parse(textBox1.Text);
            int n2 = int.Parse(textBox2.Text);
            int n3 = int.Parse(textBox3.Text);
            int temp;

            if (n1 > n2) { temp = n1; n1 = n2; n2 = temp; }
            if (n1 > n3) { temp = n1; n1 = n3; n3 = temp; }
            if (n2 > n3) { temp = n2; n2 = n3; n3 = temp; }

            textBox4.Text = $"{n1}<{n2}<{n3}";
        }
    }
}
